"""
recorder factory
"""
from common.const import RecorderType
from common.log import logger


def create_bot(recorder_type, input_queue):
    """
    create a recorder_type instance
    :param recorder_type: recorder type code
    :return: recorder instance
    """
    if recorder_type == RecorderType.PYAUDIO:
        from voice.recorder.pyaudio.pyaudio_recorder import PyAudioRecorder
        return PyAudioRecorder(input_queue)
    logger.error("not recorder type!")
    raise RuntimeError
